<template>
  <h1>defineEmits</h1>
  <p>子组件定义并触发事件，父组件监听事件</p>
  <p>{{ myMsg }}</p>
  <demo-emits-child @on-notice="onNotice"></demo-emits-child>
</template>
<script setup lang="ts">
import { ref } from "vue";
import DemoEmitsChild from "./components/DemoEmitsChild.vue";

const myMsg = ref("默认值");
const onNotice = (msg: string, ext: boolean) => {
  console.log("父组件接收到消息", msg, ext);
  myMsg.value = msg;
};

// function onNotice(msg: string, ext: boolean) {

// }
</script>
